layui.use(['element','form'], function(){
    var element = layui.element;
    var form = layui.form;

    form.on('submit(formDemo)', function(data){
        layer.msg(JSON.stringify(data.field));
        return false;
    });
    //…
});
